package com.ihr360.payroll.service.attendancereport;

import com.ihr360.attendance.AttendancePeriodReport;
import com.ihr360.common.DateRange;
import com.ihr360.commons.vo.PageData;
import com.ihr360.excel.vo.CustomSpreadSheetValidateResult;
import com.ihr360.excel.vo.ImportRequest;
import com.ihr360.excel.vo.SpreadSheetValidatorRequest;
import com.ihr360.payroll.model.dto.attendance.report.AttendanceBill;
import com.ihr360.payroll.request.AttendanceBillRequest;
import com.ihr360.payroll.response.attendance.ReportTypeResponse;
import com.ihr360.rest.service.SimpleRestService;

import java.io.OutputStream;
import java.util.List;
import java.util.Map;

public interface AttendanceBillService extends SimpleRestService<AttendanceBill, Long> {
    /**
     * 获取员工的分阶段考勤数据
     *
     * @param staffs
     * @return
     */
    Map<String, List<AttendancePeriodReport>> getPeriodReportOfStaffs(String companyId, Long salaryPlanId, Map<String, List<DateRange>> staffs, DateRange attendanceRange, int year, int month);


    /**
     * 获取员工当前类型当前考勤周期日报数据
     */
    List<AttendanceBill> getStaffDailyReport(String staffId, String companyId, Long summaryId, String type);

    /**
     * 分页获取员工所有当前周期考勤单据
     */
    PageData<AttendanceBill> getStaffAllAttendanceBill(String companyId, AttendanceBillRequest attendanceBillRequest);

    /**
     * 分页获取当前周期所有员工考勤单据
     */
    PageData<AttendanceBill> getAllAttendanceBill(String companyId, AttendanceBillRequest attendanceBillRequest);

    /**
     * 下载模板
     */
    void excelTemplateDownload(OutputStream out, Long summaryId);

    /**
     * 导入考勤单据明细
     */
    void importAttendanceBill(String companyId, ImportRequest importRequest);

    /**
     * 根据类型获取map集合
     */
    Map<String, List<AttendanceBill>> getBillTypeMap(String companyId, List<Long> reportIdList);

    /**
     * 查询单据类型列表
     */
    List<ReportTypeResponse> queryReportList(Long summaryId, String type);

    /**
     * 校验导入的员工台账数据
     *
     * @param companyId
     * @param userId
     */
    CustomSpreadSheetValidateResult validateExcelData(String companyId, String userId,
                                                      Long summaryId, SpreadSheetValidatorRequest validatorRequest);

}